<%@ page contentType="text/html;charset=UTF-8" language="java"
isELIgnored="false" %>
<%@ include file="../includes/common.jsp" %>
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
    <head>
        <title>博文搜索：${keyword} </title>
        <meta name="search" content="article" />
        <meta name="author" content="chunhai.chen(15317227@qq.com)" />
        <meta name="description" content="articles page Men's Trends" />
        <meta name="keywords" content="环球资源,中国供应商，环球资源内贸网,供应商，中国制造商,供应商目录,制造商,b2b,网上贸易,批发,内贸网" />
        <c:set var="tmp1" value="<span class='sep'>› </span><a href='/articles.htm'>所有博文</a>"/><c:set var="tmp2" value="<span class='sep'>› </span><span class='current'>搜索：${keyword}</span>"/>
        <meta name="trailLinks" content="${tmp1}${tmp2}" />
		<c:set var="requester" value="<%=request.getServerName()+ (request.getServerPort()==80 ? "" : ":"+request.getServerPort())%>"/>
    </head>
    <body>
        <c:if test="${not empty keyword}">
			<div class="box">关键字: ‘${keyword}’ 搜索结果</div>    
        </c:if>
        

        <c:if test="${not empty viewStatus && not empty viewStatus.data}">
              <c:forEach items="${viewStatus.data['articles']}" var="v" varStatus="vst">
				<div id="post-929" class="post">
	            	<div class="date"><span><fmt:formatDate value="${v.statusUpdated }" pattern="yyyy"></fmt:formatDate></span><span class="f"><fmt:formatDate value="${v.statusUpdated }" pattern="MM-dd"></fmt:formatDate></span></div>
	            	<h2><a rel="bookmark" href="/article/${v.uid}.htm" class="title">${v.name}</a></h2>
					<div class="info">
						<c:if test="${not empty v.author }">
							<span class="author"><a title="由 ${v.author.name } 发表" href="http://${v.author.blogUrl }">${v.author.name }</a></span>
						</c:if>
						<%--
	                    <span class="categories">
	                    	<a rel="category tag" title="查看 SEO探讨 的全部文章" href="/articles/seo.htm">SEO探讨</a>
	                    </span>
	                     --%>
	                    <c:if test="${not empty v.tags }">
		                    <span class="tags">
			                    <c:forTokens var="tag" items="${v.tags }" delims=",; " ><a rel="tag" href="/articles/tag/${tag }.htm">${tag }</a>&nbsp;&nbsp;</c:forTokens>	                    	
		                    </span>
	                    </c:if>
						<span class="comments">
							<a title="${v.name}上的评论" class="Comments off" href="/article/${v.uid}.htm#comments"><em>6668</em> Comments</a>
						</span>
						<div class="clear"></div>
					</div>
					<div class="intro">					 
						<c:choose>
						    <c:when test="${fn:length(v.longDesc) > 200}">${fn:substring(v.longDesc, 0, 200)} [......]</c:when>
					    	<c:otherwise>${v.longDesc}</c:otherwise>
						</c:choose>					  
						<p class="read-more"><a href="/article/${v.uid}.htm">继续阅读</a></p>
					</div>
	            </div>
              </c:forEach>

        </c:if>
        <div class="spacer"> </div>
			
		<c:if test="${totalItems > pageSize}">
			<div id="Pagination" class="pagination"></div>
		
			<script type="text/javascript" src="/js/jquery.pagination.js"></script>
	 		<script type="text/javascript">
	            /**
	             * Callback function that displays the content.
	             *
	             * Gets called every time the user clicks on a pagination link.
	             *
	             * @param {int}page_index New Page index
	             * @param {jQuery} jq the container with the pagination links as a jQuery object
	             */
				function pageselectCallback(page_index, jq){
	                // Replace old content with new content
					// $('#Searchresult').html(newcontent);
					// return false;
	                
	                return true;
	            }
	            
	
	            // When document has loaded, initialize pagination and form 
	            $(document).ready(function(){
					var url="/search/articles.htm?keyword=${keyword}&pageNo=__id__&pageSize=${pageSize}";
	
					var totalItems = ${totalItems};
	                var optInit = {
									callback: pageselectCallback,
									current_page: ${pageNo},
									link_to: url,
									items_per_page: ${pageSize},
									num_display_entries: 8,
									num_edge_entries: 2,
									prev_text: "上一页",
									next_text: "下一页"
								};
	                $("#Pagination").pagination(totalItems, optInit);              
	            });
	            
	        </script>
		</c:if>	
	
	
		
    </body>
</html>
